home *** CD-ROM | disk | FTP | other *** search
/ Chip 2005 May / CMCD0505.ISO / Software / Demo / DesktopX / objects / ktekdockv1.dxpack / {C7688C85-BCD3-43BF-A203-1A6FE72FE46E}.DXScript2 < prev    next >
Extensible Markup Language  |  2004-08-24  |  11KB  |  243 lines

  1. <?xml version="1.0"?>
  2. <!--DXScript Data File.  Version 2.0-->
  3. <DXScript>
  4.     <Control clsid="{6BF52A52-394A-11D3-B153-00C04F79FAA6}"><URL vt="8"></URL><rate vt="5">1</rate><balance vt="3">0</balance><currentPosition vt="5">0</currentPosition><defaultFrame vt="8"></defaultFrame><playCount vt="3">1</playCount><autoStart vt="11">-1</autoStart><currentMarker vt="3">0</currentMarker><invokeURLs vt="11">-1</invokeURLs><baseURL vt="8"></baseURL><volume vt="3">50</volume><mute vt="11">0</mute><uiMode vt="8">full</uiMode><stretchToFit vt="11">0</stretchToFit><windowlessVideo vt="11">0</windowlessVideo><enabled vt="11">-1</enabled><enableContextMenu vt="11">-1</enableContextMenu><fullScreen vt="11">0</fullScreen><SAMIStyle vt="8"></SAMIStyle><SAMILang vt="8"></SAMILang><SAMIFilename vt="8"></SAMIFilename><captioningID vt="8"></captioningID><enableErrorDialogs vt="11">0</enableErrorDialogs><_cx vt="19">6482</_cx><_cy vt="19">6350</_cy></Control><Script><![CDATA['Called when the script is executed
  5. Sub Object_OnScriptEnter
  6.     If CInt(Left(Control.versionInfo, InStr(Control.versionInfo,"."))) < 9 Then
  7.         Msgbox "Be aware that this object uses Windows Media Player 9 extensively." & vbNewLine & "You are running version " & Control.versionInfo & vbNewLine & "Please consider upgrading or the object may not work properly.", vbOKOnly + vbExclamation, "Version warning ..."
  8.     Else
  9.         If Control.settings.MediaAccessRights <> "full" Then
  10.             Control.settings.requestMediaAccessRights("full")
  11.         End If
  12.     End If
  13.     Control.uiMode = "None"
  14.     Control.settings.autoStart = True
  15.     control.enableContextMenu=True
  16.     Object.SetTimer 1, 1000
  17. End Sub
  18.  
  19. 'Sent when the status string changes
  20. Sub Control_StatusChange()
  21.     'DesktopX.Object("wmp_lbl_status").Text = Control.status
  22. End Sub
  23. Sub Object_OnTimer1
  24.     s=Control.Status    
  25.     desktopx.Object("wmp_lbl_status").text=s
  26.     If Left(s, 7) = "Playing" Or Left(s, 6) = "Paused" Then
  27.         DesktopX.Object("wmp_lbl_pos").Text = Control.Controls.currentPositionString & " / " & Control.currentmedia.durationstring
  28.         cp=Control.Controls.currentPosition
  29.         d=Control.currentmedia.duration
  30.         If d>0 And desktopx.ScriptObject("wmp_pb_seekslider").beingdragged=False Then
  31.             pos=Cint(desktopx.ScriptObject("wmp_pb_seekslider").travel*cp/d)
  32.             desktopx.Object("wmp_pb_seekslider").Left=desktopx.ScriptObject("wmp_pb_seekslider").oX+pos
  33.         End If
  34.     ElseIf Left(s, 7) = "Stopped" Then
  35.         DesktopX.Object("wmp_lbl_pos").Text = "00:00 / " & Control.currentmedia.durationstring
  36.         desktopx.Object("wmp_pb_seekslider").Left=desktopx.ScriptObject("wmp_pb_seekslider").oX
  37.     ElseIf s="" Then
  38.         DesktopX.Object("wmp_lbl_pos").Text = ""
  39.         DesktopX.Object("wmp_txt_track").Text = ""
  40.         DesktopX.Object("wmp_txt_title").Text = "K-Dock Media Player"
  41.         DesktopX.Object("wmp_txt_album").Text = ""
  42.         DesktopX.Object("wmp_txt_artist").Text = ""
  43.         desktopx.Object("wmp_pb_seekslider").Left=desktopx.ScriptObject("wmp_pb_seekslider").oX
  44.     Else
  45.         desktopx.Object("wmp_pb_seekslider").Left=desktopx.ScriptObject("wmp_pb_seekslider").oX
  46.     End If
  47.     Set s=nothing
  48.     Set pos=nothing
  49. End Sub
  50.  
  51. 'Sent when the item selection on the current playlist changes
  52. Sub Control_CurrentItemChange(pdispMedia)
  53.     If DesktopX.ScriptObject("lstMediaType").Control.Text = "CD Audio" Then
  54.         If DesktopX.ScriptObject("lst_tracks").Control.ListIndex <> -1 Then
  55.             x = Control.currentMedia.Name
  56.             For y = 0 To DesktopX.ScriptObject("lst_tracks").Control.ItemCount - 1
  57.                 If DesktopX.ScriptObject("lst_tracks").Control.Item(y) = x Then currentItem = y
  58.             Next
  59.             ' Set track info
  60.             DesktopX.Object("wmp_txt_track").Text = (currentItem + 1) & "  of  " & DesktopX.ScriptObject("wmp").Control.currentPlaylist.Count
  61.             DesktopX.ScriptObject("lst_tracks").Control.ListIndex = currentItem
  62.             DesktopX.Object("wmp_txt_track").Visible = True
  63.         ' Set track data
  64.         x = Control.currentMedia.getItemInfo("Author")
  65.         If Len(x) = 0 Then
  66.             DesktopX.Object("wmp_txt_artist").Visible = False
  67.             DesktopX.ScriptObject("wmp_lbl_artistmore").Object.Visible = False
  68.       Else
  69.             DesktopX.Object("wmp_txt_artist").TooltipText = x
  70.             If Len(x) > 27 Then
  71.                 DesktopX.Object("wmp_txt_artist").Text = Left(x,30) & " ..."
  72.             Else
  73.                 DesktopX.Object("wmp_txt_artist").Text = x
  74.             End If
  75.             DesktopX.Object("wmp_txt_artist").Visible = True
  76.       End If
  77.     
  78.         x = Control.currentMedia.getItemInfo("Album")
  79.         If Len(x) = 0 Then
  80.             DesktopX.Object("wmp_txt_album").Visible = False
  81.       Else
  82.             DesktopX.Object("wmp_txt_album").TooltipText = x
  83.             If Len(x) > 27 Then
  84.                 DesktopX.Object("wmp_txt_album").Text = Left(x,30) & " ..."
  85.             Else
  86.                 DesktopX.Object("wmp_txt_album").Text = x
  87.             End If
  88.             DesktopX.Object("wmp_txt_album").Visible = True
  89.       End If
  90.     
  91.         x = Control.currentMedia.getItemInfo("Title")
  92.         If Len(x) = 0 Then
  93.             DesktopX.Object("wmp_txt_title").Visible = False
  94.       Else
  95.             DesktopX.Object("wmp_txt_title").TooltipText = x
  96.             If Len(x) > 27 Then
  97.                 DesktopX.Object("wmp_txt_title").Text = Left(x,20) & " ..."
  98.             Else
  99.                 DesktopX.Object("wmp_txt_title").Text = x
  100.             End If
  101.             DesktopX.Object("wmp_txt_title").Visible = True
  102.       End If
  103.             Set x = Nothing
  104.             Set y = Nothing
  105.         End If
  106.  
  107.     ElseIf DesktopX.ScriptObject("lstMediaType").Control.Text = "Radio" Then
  108.         ' Set track info
  109.         DesktopX.Object("wmp_txt_track").Visible = True
  110.         DesktopX.Object("wmp_txt_track").Text = "radio stream"
  111.     
  112.         ' Set track data
  113.         x = Control.currentMedia.getItemInfo("Author")
  114.         If Len(x) = 0 Then
  115.             DesktopX.Object("wmp_txt_artist").Visible = False
  116.       Else
  117.             DesktopX.Object("wmp_txt_artist").TooltipText = x
  118.             If Len(x) > 27 Then
  119.                 DesktopX.Object("wmp_txt_artist").Text = Left(x,30) & " ..."
  120.             Else
  121.                 DesktopX.Object("wmp_txt_artist").Text = x
  122.             End If
  123.             DesktopX.Object("wmp_txt_artist").Visible = True
  124.       End If
  125.     
  126.         x = Control.currentMedia.getItemInfo("Title")
  127.         If Len(x) = 0 Then
  128.             DesktopX.Object("wmp_txt_album").Visible = False
  129.       Else
  130.             DesktopX.Object("wmp_txt_album").TooltipText = x
  131.             If Len(x) > 27 Then
  132.                 DesktopX.Object("wmp_txt_album").Text = Left(x,30) & " ..."
  133.             Else
  134.                 DesktopX.Object("wmp_txt_album").Text = x
  135.             End If
  136.             DesktopX.Object("wmp_txt_album").Visible = True
  137.       End If
  138.  
  139.         x = Control.currentMedia.getItemInfo("Abstract")
  140.         If Len(x) = 0 Then
  141.             DesktopX.Object("wmp_txt_title").Visible = False
  142.       Else
  143.             DesktopX.Object("wmp_txt_title").TooltipText = x
  144.             If Len(x) > 27 Then
  145.                 DesktopX.Object("wmp_txt_title").Text = Left(x,20) & " ..."
  146.             Else
  147.                 DesktopX.Object("wmp_txt_title").Text = x
  148.             End If
  149.             DesktopX.Object("wmp_txt_title").Visible = True
  150.       End If
  151.     End If
  152. End Sub
  153.  
  154. 'Sent when a media object changes
  155. Sub Control_MediaChange(Item)
  156.     thetype=DesktopX.ScriptObject("lstMediaType").Control.Text
  157.     If thetype = "Media playlist" Or thetype = "Single album" Or thetype = "Select a source ..." Then
  158.         x = Control.currentMedia.getItemInfo("Title")
  159.         For y = 0 To DesktopX.ScriptObject("lst_tracks").Control.ItemCount - 1
  160.             If DesktopX.ScriptObject("lst_tracks").Control.Item(y) = x Then
  161.                 currentItem = y
  162.                 Exit For
  163.             End If
  164.         Next
  165.         ' Set track info
  166.         DesktopX.Object("wmp_txt_track").Visible = True
  167.         DesktopX.Object("wmp_txt_track").Text = (currentItem + 1) & " of " & DesktopX.ScriptObject("wmp").Control.currentPlaylist.Count
  168.         DesktopX.ScriptObject("lst_tracks").Control.ListIndex = currentItem
  169.     
  170.         ' Set track data
  171.         x = Control.currentMedia.getItemInfo("Author")
  172.         If Len(x) = 0 Then
  173.             DesktopX.Object("wmp_txt_artist").Visible = False
  174.       Else
  175.             DesktopX.Object("wmp_txt_artist").TooltipText = x
  176.             If Len(x) > 27 Then
  177.                 DesktopX.Object("wmp_txt_artist").Text = Left(x,30) & " ..."
  178.             Else
  179.                 DesktopX.Object("wmp_txt_artist").Text = x
  180.             End If
  181.             DesktopX.Object("wmp_txt_artist").Visible = True
  182.       End If
  183.     
  184.         x = Control.currentMedia.getItemInfo("Album")
  185.         If Len(x) = 0 Then
  186.             DesktopX.Object("wmp_txt_album").Visible = False
  187.       Else
  188.             DesktopX.Object("wmp_txt_album").TooltipText = x
  189.             If Len(x) > 27 Then
  190.                 DesktopX.Object("wmp_txt_album").Text = Left(x,30) & " ..."
  191.             Else
  192.                 DesktopX.Object("wmp_txt_album").Text = x
  193.             End If
  194.             DesktopX.Object("wmp_txt_album").Visible = True
  195.       End If
  196.     
  197.         x = Control.currentMedia.getItemInfo("Title")
  198.         If Len(x) = 0 Then
  199.             DesktopX.Object("wmp_txt_title").Visible = False
  200.       Else
  201.             DesktopX.Object("wmp_txt_title").TooltipText = x
  202.             If Len(x) > 27 Then
  203.                 DesktopX.Object("wmp_txt_title").Text = Left(x,20) & " ..."
  204.             Else
  205.                 DesktopX.Object("wmp_txt_title").Text = x
  206.             End If
  207.             DesktopX.Object("wmp_txt_title").Visible = True
  208.       End If
  209.  
  210.         ' Set button visibility
  211.         If DesktopX.ScriptObject("lst_tracks").Control.ListIndex > 0 Then
  212.             DesktopX.Object("wmp_playlist_up").State = "normal"
  213.             DesktopX.Object("wmp_playlist_up").LocalStorage("state") = "normal"
  214.         Else
  215.             DesktopX.Object("wmp_playlist_up").State = "disabled"
  216.             DesktopX.Object("wmp_playlist_up").LocalStorage("state") = "disabled"
  217.         End If
  218.         
  219.         If DesktopX.ScriptObject("lst_tracks").Control.ListIndex = DesktopX.ScriptObject("lst_tracks").Control.ItemCount - 1 Then
  220.             DesktopX.Object("wmp_playlist_down").State = "disabled"
  221.             DesktopX.Object("wmp_playlist_down").LocalStorage("state") = "disabled"
  222.         Else
  223.             DesktopX.Object("wmp_playlist_down").State = "normal"
  224.             DesktopX.Object("wmp_playlist_down").LocalStorage("state") = "normal"
  225.         End If
  226.         Set x = Nothing
  227.         Set y = Nothing
  228.     End If
  229. End Sub
  230.  
  231. 'Indicates that the CD ROM media has changed
  232. Sub Control_CdromMediaChange(CdromNum)
  233.     If (DesktopX.ScriptObject("lstMediaType").Control.Text = "Audio CD") Or (DesktopX.ScriptObject("lstMediaType").Control.Text = "DVD Movie") Then
  234.         If DesktopX.ScriptObject("lstPlaylist").Control.Listindex - 1 = CdromNum Then
  235.             DesktopX.ScriptObject("lstMediaType").ResetList
  236.         End If
  237.     End If
  238. End Sub
  239.  
  240. Sub Object_OnScriptExit
  241.     Object.KillTimer 1
  242. End Sub]]></Script><Globals><Editor><PropPane>0</PropPane><EditorLeft>215</EditorLeft><EditorTop>40</EditorTop><EditorRight>1201</EditorRight><EditorBottom>697</EditorBottom></Editor><Object><LanguageCLSID>{B54F3741-5B07-11CF-A4B0-00AA004A55E8}</LanguageCLSID><ControlCLSID>{6BF52A52-394A-11D3-B153-00C04F79FAA6}</ControlCLSID><ControlObjWidth>190</ControlObjWidth><ControlObjHeight>143</ControlObjHeight><RunState>1</RunState><ManualControlLoad>0</ManualControlLoad><ScriptHostVersion>2</ScriptHostVersion></Object></Globals></DXScript>
  243.